package io.terminus.chain;

/**
 * 责任链抽象类  str因为是static的 所以每次第一次调用都应该初始化为""空字符串
 * Created by Stay on 2017/6/24  11:43.
 */
public abstract class Handler {

    protected Handler nextHandler;

    protected static String str;

    public abstract void handle(Integer num);

    public void setNextHandler(Handler nextHandler) {
        this.nextHandler = nextHandler;
    }

    protected void init(){
        str = "";
    }

    public Handler getNextHandler() {
        return nextHandler;
    }

    public static String getStr() {
        return str;
    }
}
